package org.demo.vo.daomapping;

import org.demo.vo.bean.DateTypes;
import org.telosys.persistence.mapping.AttributeMapping;
import org.telosys.persistence.mapping.DateType;
import org.telosys.persistence.mapping.EntityMapping;

public class DateTypesMapping extends EntityMapping<DateTypes>
{
	private final static Class<DateTypes> entityClass = DateTypes.class ;

	private final static String   table   = "DATETYPES" ;

	private final static String   schema  = null ;  // Can be null if not required by the database
	
	private final static AttributeMapping[] attributesMapping = new AttributeMapping[]
	{
		new AttributeMapping("id",    "ID",     true,  false, 0 ),
		new AttributeMapping("name",  "NAME",   false, false, 0 ),

		new AttributeMapping("birthdate",  "BIRTHDATE",   false, false, 0, DateType.dateOnly ),
		new AttributeMapping("birthtime",  "BIRTHTIME",   false, false, 0, DateType.timeOnly ),
		new AttributeMapping("datetime",   "DATETIME",    false, false, 0, DateType.dateAndTime ),
		
		new AttributeMapping("sqldate",      "SQLDATE",      false, false, 0 ),
		new AttributeMapping("sqltime",      "SQLTIME",      false, false, 0 ),
		new AttributeMapping("sqltimestamp", "SQLTIMESTAMP", false, false, 0 )
	};
	
	public DateTypesMapping() 
	{
		super(entityClass, table, schema, attributesMapping, null, null );
	}

}
